package com.tsk.base.autoconfigure;

import com.tsk.base.interceptor.SQLInterceptor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author: 黄嘉振
 * @create: 2023/5/17 14:09
 * @description:    自定义自动装配，后续将其他装配迁移到这里来
 **/
@Configuration
public class BaseAutoConfiguration {

    @Bean
    @ConditionalOnProperty(prefix = "spring.datasource", name = "url")
    public SQLInterceptor sqlInterceptor() {
        // 暂时先使用spring.datasource.url作为判断是否需要加载bean，如果涉及到多数据再修改
        return new SQLInterceptor();
    }
}
